object OrderFrame: TOrderFrame
  Left = 0
  Top = 0
  Width = 756
  Height = 551
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'Tahoma'
  Font.Style = []
  ParentFont = False
  TabOrder = 0
  TabStop = True
  OnResize = FrameResize
  object TopPanel: TPanel
    Left = 0
    Top = 0
    Width = 756
    Height = 27
    Align = alTop
    BevelOuter = bvNone
    TabOrder = 0
    DesignSize = (
      756
      27)
    object TitleLabel: TLabel
      Left = 1
      Top = 2
      Width = 107
      Height = 19
      Caption = 'Uus m'#252#252'giarve'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label4: TLabel
      Left = 567
      Top = 5
      Width = 187
      Height = 16
      Anchors = [akTop, akRight]
      Caption = 'Vormista arve/tellimus nimeliselt'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clNavy
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = [fsUnderline]
      ParentFont = False
      Visible = False
    end
  end
  object SummaryPanel: TPanel
    Left = 0
    Top = 196
    Width = 756
    Height = 355
    Align = alBottom
    BevelOuter = bvNone
    TabOrder = 2
    object NotesPanel: TPanel
      Left = 0
      Top = 0
      Width = 405
      Height = 355
      Align = alClient
      BevelOuter = bvNone
      TabOrder = 0
      object Label11: TLabel
        Left = 0
        Top = 0
        Width = 55
        Height = 16
        Caption = 'M'#228'rkused'
      end
      object NotesMemo: TDBMemo
        AlignWithMargins = True
        Left = 0
        Top = 20
        Width = 385
        Height = 335
        Margins.Left = 0
        Margins.Top = 0
        Margins.Right = 20
        Margins.Bottom = 0
        TabStop = False
        Align = alBottom
        Anchors = [akLeft, akTop, akRight, akBottom]
        DataField = 'MARKUSED'
        DataSource = Source
        TabOrder = 0
      end
    end
    object PaymentPanel: TPanel
      Left = 578
      Top = 0
      Width = 178
      Height = 355
      Align = alRight
      BevelOuter = bvNone
      TabOrder = 2
      object PaymentTypePanel: TPanel
        Left = 0
        Top = 0
        Width = 178
        Height = 60
        Align = alTop
        TabOrder = 0
        object PaymentLabel: TLabel
          Left = 18
          Top = 0
          Width = 54
          Height = 19
          Caption = 'Maksta:'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -16
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object DBText1: TDBText
          Left = 105
          Top = 0
          Width = 69
          Height = 23
          Alignment = taRightJustify
          DataField = 'RIDADE_SUMMA'
          DataSource = LinesSource
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -16
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object PaymentTypeCombo: TComboBox
          Left = 18
          Top = 32
          Width = 159
          Height = 24
          Style = csDropDownList
          ItemHeight = 16
          TabOrder = 0
          OnChange = PaymentTypeComboChange
          OnEnter = PaymentTypeComboEnter
          OnExit = PaymentTypeComboExit
          OnKeyPress = PaymentTypeComboKeyPress
          Items.Strings = (
            'Sularahas'
            'Pangakaardiga')
        end
      end
      object ButtonPanel: TPanel
        Left = 0
        Top = 320
        Width = 178
        Height = 35
        Align = alBottom
        TabOrder = 3
        object SpeedButton1: TSpeedButton
          Left = 152
          Top = 9
          Width = 25
          Height = 25
          Glyph.Data = {
            7E000000424D7E000000000000003E0000002800000010000000100000000100
            01000000000040000000C40E0000C40E0000020000000000000000000000FFFF
            FF00FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FEFF0000FC7F0000F83F
            0000F11F0000E38F0000F7DF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF
            0000}
        end
        object CommitButton: TButton
          Left = 18
          Top = 9
          Width = 130
          Height = 25
          Caption = 'Kinnita'
          TabOrder = 0
          OnClick = CommitButtonClick
        end
      end
      object InvoicePanel: TPanel
        Left = 0
        Top = 60
        Width = 178
        Height = 98
        Align = alTop
        TabOrder = 1
        object Label12: TLabel
          Left = 17
          Top = 14
          Width = 47
          Height = 16
          Caption = 'T'#228'htaeg'
        end
        object Label15: TLabel
          Left = 116
          Top = 42
          Width = 56
          Height = 16
          Caption = '% p'#228'evas'
        end
        object Label14: TLabel
          Left = 17
          Top = 74
          Width = 61
          Height = 16
          Caption = 'Laekumine'
        end
        object Label13: TLabel
          Left = 18
          Top = 46
          Width = 29
          Height = 16
          Caption = 'Viivis'
        end
        object DateTimePicker1: TDateTimePicker
          Left = 85
          Top = 7
          Width = 89
          Height = 24
          Date = 40026.946372430550000000
          Time = 40026.946372430550000000
          TabOrder = 0
        end
        object DBEdit2: TDBEdit
          Left = 86
          Top = 37
          Width = 26
          Height = 24
          DataSource = Source
          TabOrder = 1
        end
        object PaymentDatePicker: TDateTimePicker
          Left = 85
          Top = 69
          Width = 88
          Height = 24
          Date = 40026.946372430550000000
          Time = 40026.946372430550000000
          TabOrder = 2
          OnEnter = PaymentDatePickerEnter
          OnExit = PaymentDatePickerExit
        end
      end
      object ComboPaymentPanel: TPanel
        Left = 0
        Top = 158
        Width = 178
        Height = 98
        Align = alTop
        TabOrder = 2
        Visible = False
        object Label1: TLabel
          Left = 19
          Top = 10
          Width = 57
          Height = 16
          Caption = 'Sularahas'
        end
        object Label2: TLabel
          Left = 18
          Top = 39
          Width = 50
          Height = 16
          Caption = 'Kaardiga'
        end
        object CombinedCashEdit: TDBEdit
          Left = 102
          Top = 6
          Width = 70
          Height = 24
          TabOrder = 0
          OnEnter = CombinedCashEditEnter
          OnExit = CombinedCashEditExit
        end
      end
    end
    object PreorderPanel: TPanel
      Left = 405
      Top = 0
      Width = 173
      Height = 355
      Align = alRight
      BevelOuter = bvNone
      TabOrder = 1
      object Label7: TLabel
        Left = 0
        Top = -1
        Width = 125
        Height = 19
        Caption = 'Tellimuse t'#228'htaeg'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Bevel1: TBevel
        Left = 160
        Top = 0
        Width = 13
        Height = 355
        Align = alRight
        Shape = bsRightLine
        ExplicitLeft = 152
        ExplicitTop = 16
        ExplicitHeight = 98
      end
      object Label3: TLabel
        Left = 0
        Top = 36
        Width = 48
        Height = 16
        Caption = 'Kuup'#228'ev'
      end
      object Label5: TLabel
        Left = 0
        Top = 65
        Width = 48
        Height = 16
        Caption = 'Kellaaeg'
      end
      object Label6: TLabel
        Left = 0
        Top = 117
        Width = 64
        Height = 19
        Caption = 'Ettemaks'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
      end
      object Label8: TLabel
        Left = 0
        Top = 147
        Width = 57
        Height = 16
        Caption = 'Sularahas'
      end
      object Label9: TLabel
        Left = 1
        Top = 173
        Width = 50
        Height = 16
        Caption = 'Kaardiga'
      end
      object DBEditDateTimePicker3: TDateTimePicker
        Left = 70
        Top = 33
        Width = 69
        Height = 24
        Date = 40026.946372430550000000
        Time = 40026.946372430550000000
        TabOrder = 0
      end
      object DBComboBox1: TDBComboBox
        Left = 70
        Top = 63
        Width = 69
        Height = 24
        DataSource = Source
        ItemHeight = 16
        Items.Strings = (
          '08:00'
          '08:30'
          '09:00'
          '09:30')
        TabOrder = 1
      end
      object PreorderCardEdit: TDBEdit
        Left = 70
        Top = 169
        Width = 69
        Height = 24
        TabOrder = 3
      end
      object DBEdit5: TDBEdit
        Left = 70
        Top = 141
        Width = 69
        Height = 24
        TabOrder = 2
      end
    end
  end
  object LinesGrid: TDBGrid
    AlignWithMargins = True
    Left = 0
    Top = 27
    Width = 756
    Height = 149
    Margins.Left = 0
    Margins.Top = 0
    Margins.Right = 0
    Margins.Bottom = 20
    Align = alClient
    DataSource = LinesSource
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    Options = [dgEditing, dgAlwaysShowEditor, dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
    ParentFont = False
    TabOrder = 1
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -13
    TitleFont.Name = 'Tahoma'
    TitleFont.Style = []
    OnColEnter = LinesGridColEnter
    OnEditButtonClick = LinesGridEditButtonClick
    OnEnter = LinesGridEnter
    OnExit = LinesGridExit
    OnKeyDown = LinesGridKeyDown
    OnKeyPress = LinesGridKeyPress
    OnKeyUp = LinesGridKeyUp
    OnMouseUp = LinesGridMouseUp
    OnMouseWheelDown = LinesGridMouseWheelDown
    OnMouseWheelUp = LinesGridMouseWheelUp
    Columns = <
      item
        ButtonStyle = cbsEllipsis
        Expanded = False
        FieldName = 'NIMETUS'
        Title.Caption = 'Nimetus'
        Width = 324
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'KOGUS'
        Title.Caption = 'Kogus'
        Width = 42
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'HIND'
        Title.Alignment = taRightJustify
        Title.Caption = 'Hind'
        Width = 68
        Visible = True
      end
      item
        Alignment = taRightJustify
        Expanded = False
        FieldName = 'KEHTIV_ALATES'
        Title.Caption = 'Kehtiv alates'
        Width = 78
        Visible = True
      end
      item
        Alignment = taRightJustify
        Expanded = False
        FieldName = 'KEHTIV_KUNI'
        Title.Caption = 'Kehtiv kuni'
        Width = 77
        Visible = True
      end>
  end
  object Source: TDataSource
    DataSet = Ds
    Left = 352
    Top = 8
  end
  object LinesSource: TDataSource
    DataSet = LinesDs
    Left = 510
    Top = 120
  end
  object LinesDs: TClientDataSet
    Aggregates = <>
    AggregatesActive = True
    Params = <
      item
        DataType = ftInteger
        Name = 'order_id'
        ParamType = ptInput
        Value = '1'
      end>
    ProviderName = 'LinesProvider'
    AfterEdit = LinesDsAfterEdit
    BeforePost = LinesDsBeforePost
    AfterPost = LinesDsAfterPost
    Left = 544
    Top = 120
    object LinesDsARVE_ID: TIntegerField
      FieldName = 'ARVE_ID'
      Required = True
    end
    object LinesDsREA_NR: TSmallintField
      FieldName = 'REA_NR'
    end
    object LinesDsTOOTE_ID: TIntegerField
      FieldName = 'TOOTE_ID'
    end
    object LinesDsNIMETUS: TStringField
      FieldName = 'NIMETUS'
      Size = 400
    end
    object LinesDsKOGUS: TBCDField
      FieldName = 'KOGUS'
      Precision = 9
      Size = 3
    end
    object LinesDsHIND: TBCDField
      FieldName = 'HIND'
      Precision = 9
      Size = 2
    end
    object LinesDsKM: TBCDField
      FieldName = 'KM'
      Precision = 9
      Size = 2
    end
    object LinesDsALE: TBCDField
      FieldName = 'ALE'
      Precision = 9
      Size = 2
    end
    object LinesDsSEOTUD_ARVE_ID: TIntegerField
      FieldName = 'SEOTUD_ARVE_ID'
    end
    object LinesDsSEOTUD_ARVE_REA_NR: TSmallintField
      FieldName = 'SEOTUD_ARVE_REA_NR'
    end
    object LinesDsKEHTIV_ALATES: TDateField
      FieldName = 'KEHTIV_ALATES'
    end
    object LinesDsKEHTIV_KUNI: TDateField
      FieldName = 'KEHTIV_KUNI'
    end
    object LinesDsRIDADE_SUMMA: TAggregateField
      FieldName = 'RIDADE_SUMMA'
      Active = True
      Expression = 'sum(hind)'
    end
  end
  object LinesProvider: TDataSetProvider
    DataSet = LinesQuery
    UpdateMode = upWhereKeyOnly
    Left = 576
    Top = 120
  end
  object Ds: TClientDataSet
    Aggregates = <>
    Params = <
      item
        DataType = ftInteger
        Name = 'id'
        ParamType = ptInput
        Value = '1'
      end>
    ProviderName = 'Provider'
    BeforePost = DsBeforePost
    Left = 384
    Top = 8
    object DsID: TIntegerField
      FieldName = 'ID'
      Required = True
    end
    object DsKLIENDI_ID: TIntegerField
      FieldName = 'KLIENDI_ID'
    end
    object DsTELLIMUSE_AEG: TSQLTimeStampField
      FieldName = 'TELLIMUSE_AEG'
    end
    object DsTELLIMUSE_TAHTAEG: TSQLTimeStampField
      FieldName = 'TELLIMUSE_TAHTAEG'
    end
    object DsETTEMAKS_SULAS: TBCDField
      FieldName = 'ETTEMAKS_SULAS'
      Precision = 9
      Size = 2
    end
    object DsETTEMAKS_KAARDIGA: TBCDField
      FieldName = 'ETTEMAKS_KAARDIGA'
      Precision = 9
      Size = 2
    end
    object DsARVE_AEG: TSQLTimeStampField
      FieldName = 'ARVE_AEG'
    end
    object DsARVE_SUMMA: TBCDField
      FieldName = 'ARVE_SUMMA'
      Precision = 9
      Size = 2
    end
    object DsMAKSEVIIS: TSmallintField
      FieldName = 'MAKSEVIIS'
    end
    object DsMAKSETAHTAEG: TDateField
      FieldName = 'MAKSETAHTAEG'
    end
    object DsMAKSMISE_AEG: TSQLTimeStampField
      FieldName = 'MAKSMISE_AEG'
    end
    object DsMAKSTUD_SULAS: TBCDField
      FieldName = 'MAKSTUD_SULAS'
      Precision = 9
      Size = 2
    end
    object DsMAKSTUD_PANKA: TBCDField
      FieldName = 'MAKSTUD_PANKA'
      Precision = 9
      Size = 2
    end
    object DsMARKUSED: TStringField
      FieldName = 'MARKUSED'
      Size = 2000
    end
    object DsKLIENDI_GRUPP: TStringField
      FieldName = 'KLIENDI_GRUPP'
      Size = 50
    end
  end
  object Provider: TDataSetProvider
    DataSet = Query
    UpdateMode = upWhereKeyOnly
    Left = 416
    Top = 8
  end
  object Query: TSQLDataSet
    SchemaName = 'sysdba'
    GetMetadata = False
    CommandText = 
      'select '#13#10'id,'#13#10'kliendi_id,'#13#10'tellimuse_aeg,'#13#10'tellimuse_tahtaeg,'#13#10'e' +
      'ttemaks_sulas,'#13#10'ettemaks_kaardiga,'#13#10'arve_aeg,'#13#10'arve_summa,'#13#10'maks' +
      'eviis,'#13#10'maksetahtaeg,'#13#10'maksmise_aeg,'#13#10'makstud_sulas,'#13#10'makstud_pa' +
      'nka,'#13#10'markused,'#13#10'kliendi_grupp'#13#10'from ARVED'#13#10'where id = :id'
    MaxBlobSize = -1
    Params = <
      item
        DataType = ftInteger
        Name = 'id'
        ParamType = ptInput
        Value = '1'
      end>
    SQLConnection = ProgramModule.Connection
    Left = 448
    Top = 8
  end
  object LinesQuery: TSQLDataSet
    SchemaName = 'sysdba'
    GetMetadata = False
    CommandText = 
      'select'#13#10'ar.arve_id,'#13#10'ar.rea_nr,'#13#10'ar.toote_id,'#13#10't.nimetus,'#13#10'ar.ko' +
      'gus,'#13#10'ar.hind,'#13#10'ar.km,'#13#10'ar.ale,'#13#10'ar.seotud_arve_id,'#13#10'ar.seotud_a' +
      'rve_rea_nr,'#13#10'ar.kehtiv_alates,'#13#10'ar.kehtiv_kuni'#13#10'from ARVE_READ a' +
      'r'#13#10'join tooted t on t.id = ar.toote_id'#13#10'where ar.arve_id = :orde' +
      'r_id'#13#10'order by rea_nr'
    MaxBlobSize = -1
    Params = <
      item
        DataType = ftInteger
        Name = 'order_id'
        ParamType = ptInput
        Value = '1'
      end>
    SQLConnection = ProgramModule.Connection
    Left = 608
    Top = 120
    object LinesQueryARVE_ID: TIntegerField
      FieldName = 'ARVE_ID'
      Required = True
    end
    object LinesQueryREA_NR: TSmallintField
      FieldName = 'REA_NR'
      Required = True
    end
    object LinesQueryTOOTE_ID: TIntegerField
      FieldName = 'TOOTE_ID'
    end
    object LinesQueryNIMETUS: TStringField
      FieldName = 'NIMETUS'
      Size = 100
    end
    object LinesQueryKOGUS: TBCDField
      FieldName = 'KOGUS'
      Precision = 9
      Size = 3
    end
    object LinesQueryHIND: TBCDField
      FieldName = 'HIND'
      Precision = 9
      Size = 2
    end
    object LinesQueryKM: TBCDField
      FieldName = 'KM'
      Precision = 9
      Size = 2
    end
    object LinesQueryALE: TBCDField
      FieldName = 'ALE'
      Precision = 9
      Size = 2
    end
    object LinesQuerySEOTUD_ARVE_ID: TIntegerField
      FieldName = 'SEOTUD_ARVE_ID'
    end
    object LinesQuerySEOTUD_ARVE_REA_NR: TSmallintField
      FieldName = 'SEOTUD_ARVE_REA_NR'
    end
    object LinesQueryKEHTIV_ALATES: TDateField
      FieldName = 'KEHTIV_ALATES'
    end
    object LinesQueryKEHTIV_KUNI: TDateField
      FieldName = 'KEHTIV_KUNI'
    end
  end
  object ActionList: TActionList
    Left = 136
    Top = 304
  end
  object PopupMenu1: TPopupMenu
    Left = 594
    Top = 11
  end
end
